home *** CD-ROM | disk | FTP | other *** search
/ L' Effet Pommier 3 / L'Effet Pommier - Volume 03.iso / Programmation / Alpha ƒ / Tcl / SystemCode / AlphaBits.tcl < prev    next >
Text File  |  1996-01-14  |  4KB  |  162 lines

  1. set alphaLite [expr ![file exists "$HOME:Tcl:SystemCode:modeDefs.tcl"]]
  2.  
  3.  
  4. # if {[string match {*b[0-9]*} [version]] && ![file exists "Powerpete:C"]} {
  5. #     alertnote "This is a BETA version of Alpha. Do NOT redistribute!"
  6. # }
  7.  
  8.  
  9. #if {[regexp {[]\(\)\"\{\}\[]} $HOME]} {alertnote "Alpha may not work properly if it's pathname includes parenthesis, square brackets, double quotes, or curly braces."}
  10. # Get name Alpha's current name.
  11. foreach p [processes] {
  12.     if {[lindex $p 1] == "ALFA"} {
  13.         set ALPHA [lindex $p 0]
  14.         break
  15.     }
  16. }
  17.  
  18.  
  19. # Icon menu names. The number refers to the resource id of the #ics family.
  20. #set fsetMenuName     "SetFiles"
  21. set fsetMenuName     "Ñ131"
  22. # set helpMenu        "Ñ130"
  23. set cwarriorMenu    "Ñ268"
  24. set cwdebugMenu        "Ñ274"
  25. set latexMenu        "Ñ270"
  26. set perlMenu         "Ñ132"
  27. set tclMenu            "Ñ269"
  28. set terrMenu        "Ñ271"
  29. set thinkMenu         "Ñ300"
  30. set thinkRefMenu    "Ñ265"
  31. set toolboxRefMenu    "Ñ400"
  32. set toolserverMenu    "Ñ133"
  33. set htmlMenu        "Ñ135"
  34. set winMenu         "Ñ263"
  35. set mailMenu         "Ñ138"
  36.  
  37.  
  38. # A few definitions I'll need later.
  39. proc quoteExpr str {
  40.     regsub -all {\\} $str {\\\\} str
  41.     regsub -all {\|} $str {\|} str
  42.     regsub -all {\*} $str {\\*} str
  43.     regsub -all {\+} $str {\\+} str
  44.     regsub -all {\(} $str {\\(} str
  45.     regsub -all {\)} $str {\\)} str
  46.     regsub -all {\[} $str {\\[} str
  47.     regsub -all {\]} $str {\\]} str
  48.     return $str
  49. }
  50.  
  51. proc quoteExpr2 str {
  52.     regsub -all {\\} $str {\\\\} str
  53.     regsub -all {\|} $str {\|} str
  54.     regsub -all {\*} $str {\\*} str
  55.     regsub -all {\+} $str {\\+} str
  56.     regsub -all {\(} $str {\\(} str
  57.     regsub -all {\)} $str {\\)} str
  58.     regsub -all {\{} $str "\\\{" str
  59.     regsub -all {\}} $str "\\\}" str
  60.     regsub -all {\[} $str {\\[} str
  61.     regsub -all {\]} $str {\\]} str
  62.     return $str
  63. }
  64.  
  65. if {$alphaLite} {
  66.     set auto_path [list $HOME:Tcl:SystemCode]
  67. } else {
  68.     set auto_path [list $HOME:Tcl:SystemCode $HOME:Tcl:UserCode]
  69. }
  70.  
  71. source "$HOME:Tcl:SystemCode:library.tcl"
  72.  
  73. if {$alphaLite} {
  74.     source "$HOME:Tcl:SystemCode:menusLite.tcl"
  75.     menu -n install {}
  76. } else {
  77.     source "$HOME:Tcl:SystemCode:menus.tcl"
  78. }
  79. source "$HOME:Tcl:SystemCode:keyBindings.tcl"
  80. source "$HOME:Tcl:SystemCode:definitions.tcl"
  81. source "$HOME:Tcl:SystemCode:procs.tcl"
  82. source "$HOME:Tcl:SystemCode:flags.tcl"
  83. source "$HOME:Tcl:SystemCode:modes.tcl"
  84. if {$alphaLite} {
  85.     lappend modes Brws
  86.     set modeMenus(Brws)             { }
  87.     set dummyProc(Brws)                dummyBrws
  88. } else {
  89.     source "$HOME:Tcl:SystemCode:filesets.tcl"
  90. }
  91. source "$HOME:Tcl:SystemCode:copyRing.tcl"
  92.  
  93. catch {source "$HOME:Tcl:SystemCode:latexMode.tcl"}
  94. if {!$alphaLite} {
  95.     catch {source "$HOME:Tcl:SystemCode:bibtexMode.tcl"}
  96.     catch {source "$HOME:Tcl:SystemCode:MacPerlmode.tcl"}
  97.     catch {source "$HOME:Tcl:SystemCode:htmlMode.tcl"}
  98. }
  99.  
  100.  
  101. # Bogus, but needs to be before userStartup read.
  102. set cwSig MMCC
  103. set cwdSig MWDB
  104.  
  105. set useEmacs 1
  106.  
  107. # Read both scalar and array definitions from preferences folder.
  108. catch {readUserDefs}
  109.  
  110. # After userprefs read.
  111. source "$HOME:Tcl:SystemCode:emacs.tcl"
  112.  
  113. if {!$alphaLite} {
  114.     # Set up color indices
  115.     foreach ind [array names colorInds] {
  116.         eval setRGB $ind $colorInds($ind)
  117.     }
  118. }
  119.  
  120.  
  121. # Should be last so all filesets make it in.
  122. message "Building filesets..."
  123.  
  124. rebuildFilesetMenu
  125.  
  126. buildRecentFiles
  127.  
  128. set modes [lsort $modes]
  129.  
  130.  
  131. if {![info exists readReadme] || ($readReadme != [string trim [lindex [version] 2] {,}])} {
  132.     addDef readReadme [string trim [lindex [version] 2] {,}]
  133.     edit -r "$HOME:Help:Readme"
  134. } else {unset readReadme}
  135.  
  136.  
  137. source "$HOME:Tcl:SystemCode:paths.tcl"
  138. if {$alphaLite} {
  139. #     source "$HOME:Tcl:SystemCode:latex.tcl"
  140. #     insertMenu $latexMenu    
  141. } else {
  142.     source "$HOME:Tcl:SystemCode:smarterSource.tcl"
  143.  
  144.     setupPrintMenu
  145.  
  146.     foreach    m [lsort $modes] {
  147.         addMenuItem    -m modePrefs $m
  148.     }
  149.  
  150.     # "Switch To" submenu...
  151.     buildSwitches
  152.     
  153.     if {$showEudoraMenu} {
  154.         showEudoraMenuProc showEudoraMenu
  155.     }
  156. }
  157.  
  158. message "Initialization Complete"
  159.  
  160.  
  161.  
  162.